<%@page import="cn.edu.pku.wxlib.user.model.*" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/commons/taglibs.jsp" %>

<rapid:override name="head">
	<title>User信息</title>
</rapid:override>

<rapid:override name="content">
	<form:form modelAttribute="user,teacher,student" class="form-horizontal">
		<input class="btn btn-default" type="button" value="返回列表" onclick="window.location='${ctx}/user'"/>
		<input class="btn btn-default" type="button" value="后退" onclick="history.back();"/>
		
		<input type="hidden" id="userId" name="userId" value="${user.userId}"/>
		<div class="gridTable">
		<table class="table text-center">
			<div class="form-group">
				<label for="userName" class="col-sm-5 control-label">用户名:</label>
				<p class="form-field-special ">&nbsp;<c:out value='${user.userName}'/></p>
			</div>
			<div class="form-group">
				<label for="name" class="col-sm-5 control-label">姓名:</label>
				<p class="form-field-special ">&nbsp;<c:out value='${user.name}'/></p>
			</div>
			<div class="form-group">
				<label for="birth" class="col-sm-5 control-label">出生年月日:</label>
				<p class="form-field-special ">&nbsp;<c:out value='${user.birthString}'/></p>
			</div>
			<div class="form-group">
				<label for="gender" class="col-sm-5 control-label">性别:</label>
				<p class="form-field-special ">
				<c:choose> 
						<c:when test="${user.type eq 1}">男</c:when>
						<c:when test="${user.type eq 2}">女</c:when>
				</c:choose> </p>
			</div>
			<div class="form-group">
				<label for="tel" class="col-sm-5 control-label">座机:</label>
				<p class="form-field-special ">&nbsp;<c:out value='${user.tel}'/></p>
			</div>
			<div class="form-group">
				<label for="phone" class="col-sm-5 control-label">手机:</label>
				<p class="form-field-special ">&nbsp;<c:out value='${user.phone}'/></p>
			</div>
			<div class="form-group">
				<label for="email" class="col-sm-5 control-label">电子邮箱:</label>
				<p class="form-field-special ">&nbsp;<c:out value='${user.email}'/></p>
			</div>
			<div class="form-group">
				<label for="type" class="col-sm-5 control-label">用户类型:</label>
				<p class="form-field-special ">
				<c:choose> 
						<c:when test="${user.type eq 1}">老师</c:when>
						<c:when test="${user.type eq 2}">学生</c:when>
				</c:choose> 
				</p>
			</div>
			<div class="form-group">
				<label for="createTimeString" class="col-sm-5 control-label">创建时间:</label>
				<p class="form-field-special ">&nbsp;<c:out value='${user.createTimeString}'/></p>
			</div>
			<div class="form-group">
				<label for="state" class="col-sm-5 control-label">状态:</label>
				<p class="form-field-special ">
				<c:choose> 
						<c:when test="${user.state eq 0}">禁用</c:when>
						<c:when test="${user.state eq 1}">启用</c:when>
				</c:choose> 
				</p>
			</div>
			<c:choose>
			<c:when test="${not empty student}">
				<div class="form-group">
					<label for="studentNumber" class="col-sm-5 control-label">学号:</label>
					<p class="form-field-special ">&nbsp;<c:out value='${student.studentNumber}'/></p>
				</div>
				<div class="form-group">
					<label for="school" class="col-sm-5 control-label">学校:</label>
					<p class="form-field-special ">&nbsp;<c:out value='${student.school}'/></p>
				</div>
				<div class="form-group">
					<label for="major" class="col-sm-5 control-label">专业:</label>
					<p class="form-field-special ">&nbsp;<c:out value='${student.major}'/></p>
				</div>
				<div class="form-group">
					<label for="direction" class="col-sm-5 control-label">方向:</label>
					<p class="form-field-special ">&nbsp;<c:out value='${student.direction}'/></p>
				</div>
				<div class="form-group">
					<label for="entranceClass" class="col-sm-5 control-label">入学年份:</label>
					<p class="form-field-special ">&nbsp;<c:out value='${student.entranceClass}'/></p>
				</div>
				<div class="form-group">
					<label for="minYear" class="col-sm-5 control-label">最短学制</label>
					<p class="form-field-special ">&nbsp;<c:out value='${student.minYear}'/></p>
				</div>
				<div class="form-group">
					<label for="maxYear" class="col-sm-5 control-label">最长学制:</label>
					<p class="form-field-special ">&nbsp;<c:out value='${student.maxYear}'/></p>
				</div>
			</c:when>
			<c:when test="${not empty teacher}">
				<div class="form-group">
					<label for="teacherNumber" class="col-sm-5 control-label">教工号:</label>
					<p class="form-field-special ">&nbsp;<c:out value='${teacher.teacherNumber}'/></p>
				</div>
				<div class="form-group">
					<label for="department" class="col-sm-5 control-label">系名:</label>
					<p class="form-field-special ">&nbsp;<c:out value='${teacher.department}'/></p>
				</div>
				<div class="form-group">
					<label for="direction" class="col-sm-5 control-label">研究方向:</label>
					<p class="form-field-special ">&nbsp;<c:out value='${teacher.direction}'/></p>
				</div>
				<div class="form-group">
					<label for="title" class="col-sm-5 control-label">职称:</label>
					<p class="form-field-special ">&nbsp;<c:out value='${teacher.title}'/></p>
				</div>
				<div class="form-group">
					<label for="office" class="col-sm-5 control-label">办公室:</label>
					<p class="form-field-special ">&nbsp;<c:out value='${teacher.office}'/></p>
				</div>
			</c:when>
			</c:choose>
<!-- 			<tr> -->
<!-- 				<td class="tdLabel">关联的老师表或学生表主键</td>	 -->
<%-- 				<td><c:out value='${user.relatedId}'/></td> --%>
<!-- 			</tr> -->
<!-- 			<tr>	 -->
<!-- 				<td class="tdLabel">userName</td>	 -->
<%-- 				<td><c:out value='${user.userName}'/></td> --%>
<!-- 			</tr> -->
<!-- 			<tr>	 -->
<!-- 				<td class="tdLabel">name</td>	 -->
<%-- 				<td><c:out value='${user.name}'/></td> --%>
<!-- 			</tr> -->
<!-- 			<tr>	 -->
<!-- 				<td class="tdLabel">password</td>	 -->
<%-- 				<td><c:out value='${user.password}'/></td> --%>
<!-- 			</tr> -->
<!-- 			<tr>	 -->
<!-- 				<td class="tdLabel">出生年与日</td>	 -->
<%-- 				<td><c:out value='${user.birthString}'/></td> --%>
<!-- 			</tr> -->
<!-- 			<tr>	 -->
<!-- 				<td class="tdLabel">gender</td>	 -->
<%-- 				<td><c:out value='${user.gender}'/></td> --%>
<!-- 			</tr> -->
<!-- 			<tr>	 -->
<!-- 				<td class="tdLabel">座机</td>	 -->
<%-- 				<td><c:out value='${user.tel}'/></td> --%>
<!-- 			</tr> -->
<!-- 			<tr>	 -->
<!-- 				<td class="tdLabel">手机</td>	 -->
<%-- 				<td><c:out value='${user.phone}'/></td> --%>
<!-- 			</tr> -->
<!-- 			<tr>	 -->
<!-- 				<td class="tdLabel">email</td>	 -->
<%-- 				<td><c:out value='${user.email}'/></td> --%>
<!-- 			</tr> -->
<!-- 			<tr>	 -->
<!-- 				<td class="tdLabel">1老师，2学生</td>	 -->
<%-- 				<td><c:out value='${user.type}'/></td> --%>
<!-- 			</tr> -->
<!-- 			<tr>	 -->
<!-- 				<td class="tdLabel">借阅类型Id</td>	 -->
<%-- 				<td><c:out value='${user.borrowTypeId}'/></td> --%>
<!-- 			</tr> -->
<!-- 			<tr>	 -->
<!-- 				<td class="tdLabel">createTime</td>	 -->
<%-- 				<td><c:out value='${user.createTimeString}'/></td> --%>
<!-- 			</tr> -->
<!-- 			<tr>	 -->
<!-- 				<td class="tdLabel">1启用，0禁用</td>	 -->
<%-- 				<td><c:out value='${user.state}'/></td> --%>
<!-- 			</tr> -->
		</table>
		</div>
	</form:form>
</rapid:override>

<%@ include file="base.jsp" %>